Skip to content

Third try for a fix for #1044: handle TypevarsMissContext mode in wildApprox #1064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2016

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 5, 2016

Review by @odersky, this is an alternative to #1054


When wildApprox encounters a PolyParam it approximates it by its
bounds in the current constraint set, but this is incorrect if
TypevarsMissContext is set, we might get the bounds of another use of
this PolyType. This is exactly what happened in i1044.scala where the
implicit view refArrayOps needs to be used twice with two different
type parameters.

The fix is to approximate a PolyParam by its original bounds in its
PolyType if TypevarsMissContext is set.

This fix was inspired by the approach of #1054.

When `wildApprox` encounters a PolyParam it approximates it by its
bounds in the current constraint set, but this is incorrect if
`TypevarsMissContext` is set, we might get the bounds of another use of
this `PolyType`. This is exactly what happened in i1044.scala where the
implicit view `refArrayOps` needs to be used twice with two different
type parameters.

The fix is to approximate a PolyParam by its original bounds in its
PolyType if `TypevarsMissContext` is set.

This fix was inspired by the approach of scala#1054.
smarter added a commit that referenced this pull request Feb 6, 2016
Third try for a fix for #1044: handle TypevarsMissContext mode in wildApprox
@smarter smarter merged commit ffcc27b into scala:master Feb 6, 2016
@smarter smarter mentioned this pull request Feb 6, 2016
@allanrenucci allanrenucci deleted the fix-#1044-take-3 branch December 14, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants